import type { CardItem } from './cardModel';

export type DeckCardItem = Writable<
  Partial<CardItem> & {
    number?: number;
  }
>;

export enum ReviewStatusEnum {
  ING,
  PASS,
  FAIL,
}

export type DeckDetail = {
  id: number; //套牌id
  user_id: number; //用户id
  nickname: string; //用户昵称
  deck_name: string; //套牌名称
  main_fighters: DeckCardItem[]; //主战者列表
  main_cards_number: number; //主牌总数
  main_cards: DeckCardItem[]; //主牌列表
  other_cards_number: number; //备牌总数
  other_cards: DeckCardItem[]; //备牌列表
  created_at: number; //创建时间
  updated_at: number; //修改时间
  review_status: ReviewStatusEnum; // 审核状态
};

export type DeckItem = Pick<DeckDetail, 'id' | 'deck_name' | 'main_cards_number' | 'created_at' | 'review_status'> & {
  imgs: string[]; //主战者缩略图列表
  isCheck: boolean;
};

export type DeckList = {
  total: number;
  rows: Array<DeckItem>;
};

export type DeckListQuery = { page: number; page_size: number };

export type CreateDeck = Pick<DeckDetail, 'deck_name' | 'main_fighters' | 'main_cards' | 'other_cards'>;

export type ModifyDeck = Pick<DeckDetail, 'id' | 'deck_name' | 'main_fighters' | 'main_cards' | 'other_cards'>;
